<template>
  <div>
    <h3>我是子组件---{{ num }}</h3>
    <button @click="btnClick">点击+1</button>
  </div>
</template>
<script>
export default {
  props: {
    num: { type: Number, required: true }
  },
  methods: {
    btnClick() {
      this.$emit('update:num', this.num + 1)
    }
  }
}
</script>
<style></style>
